package com.artfii.fluentsql.core.jdbc;

import com.artfii.fluentsql.core.exception.FluentSqlException;

import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.SQLException;

/**
 * Func:   :
 *
 * @author : Lqf(leeton)
 * @date : 2021/6/4.
 */
public class DefaultConnectionProvider implements ConnectionProvider{
    @Override
    public Connection buildOfDs(DataSource dataSource) {
        try {
            return dataSource.getConnection();
        } catch (SQLException ex) {
            throw new FluentSqlException(ex);
        }
    }

}
